Repository navigation
docs(adr): ADR-0093 D3 amendment note, bulk import joins the administrator's current organization - #35035
Conversation
…rator's current organization The D3 amendment of 2026-10-24 closes on a sentence that lists bulk import among the creation paths that bind nothing in multi mode. Since merge commit 36af6b0 (maintainer ruling 6942842013, option B) the admin import joins each row to the importing administrator's current organization. Add-only: a dated amendment note (2026-11-17) under that amendment records what landed, with symbol anchors into the shared settlement and join, and the status line gains its Amended entry. The ruled sentence is not rewritten. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgwLiKcfujYUug7sPs
|
repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB L1 review (#34809) · 2026-11-18T00:04ZL1: ACCEPT Tier H ( Must-fixNone. Should-fixNone. What I checkedEach bullet of the note, against the code at this head:
Notes (for the seat's L2 and the approver)
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract-review-claim: session_01WGufzgh1zkZzDXL36ckWAG · head |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: The one file of the diff is the Security-touching is ① Derived judgments
② Semver levelClause-②: no No changeset, ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. Each sentence of the note, read against the code:
Internal consistency of the record after the note. I read every sentence of the head that mentions import or multi-mode binding (TL;DR, Context, D1, D2 coverage, the D3 table, D7, D8.4, the D8 amendment's consequences, Rollout phase 2). The one live sentence the note contradicts is the 2026-10-24 closing sentence, and the note says so in its second sentence. D2's coverage line and Rollout phase 2 are about the reconciler, which still binds import-created users in single mode and nothing in multi mode. The D3 table's
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG 席位记录 · 2026-11-18T00:13ZHead-sha: 维护者速读(终稿)
席位意见:建议批准。说明与代码一致,ADR 内部没有未声明的矛盾。 席位核对
|
Fixes #34809
Clause-②: no
Metadata-protocol: none
维护者速读
36af6b05a7)已经落地。ADR 那一句还写着批量导入在多组织下不绑定任何组织,和代码相左。docs/adr/0093-tenancy-mode-and-membership-lifecycle.md第 276–307 行的修订说明。风险点是 upsert 那一条:它写明「已属于其他组织的已有用户,被 CSV 匹配到时也会加入管理员当前组织」。再看第 3 行状态行末尾新增的一句。node scripts/check-adr-symbol-anchors.mjs && node scripts/check-adr-links.mjs && node scripts/adr-index.mjs --check,预期三条都以 0 退出,最后一条印adr-index: OK。What changes
One file,
docs/adr/0093-tenancy-mode-and-membership-lifecycle.md, +34 / −1:Amendment note (date, ruling)blockquote form (the form of its 2026-11-11 note under D8). It says the amendment's closing sentence no longer holds for bulk import, and records what PR fix(plugin-auth)!: import-users joins each row to the administrator's current organization in multi-org mode #34750 landed forPOST /api/v1/auth/admin/import-users. It cites maintainer ruling 6942842013 (option B) and merge commit36af6b05a7.Amendedentry dated 2026-11-17, as the two later amendments of this record did (2026-11-08 and 2026-11-11). This is the one modified line of the diff: the entry is appended to the single status line.docs/adr/README.mdis unchanged.node scripts/adr-index.mjs --checkanswers that it is current (the index shows only the head of a status line).Tests
None: the diff is one ADR. Nothing published moves, so no changeset (
skip-changeset).Acceptance notes
The landed facts, FROM → TO, each read at
origin/main4443014630. "Walled posture" istenancy.isolationActive === true, the predicatepackages/plugins/plugin-auth/src/admin-user-endpoints.ts#multiOrgCreationJoinsCurrentOrganizationreads.36af6b05a7mainsettleCurrentOrganizationJoinruns beforerunImport, with nodryRunbranch before itpackages/plugins/plugin-auth/src/admin-import-users.ts#runAdminImportUsersno current organizationcases (dryRunfalse and true)200, rows created in no organization400 NO_ACTIVE_ORGANIZATION, Create User's sentence, nothing createdpackages/plugins/plugin-auth/src/admin-user-endpoints.ts#settleCurrentOrganizationJoinaddMemberon better-auth's API200, rows created501 NOT_IMPLEMENTED, nothing created!seamoraddMembernot a function)a host with no unit of work, or no organization plugincreateUserandjoinCurrentOrganizationinsidejoin.seam.runAtomicallyinRowUnitinrunAdminImportUsers;packages/plugins/plugin-auth/src/admin-user-endpoints.ts#joinCurrentOrganizationevery created row joins; dogfood I1failedwith the vendor's code, account rolled back, no temporary password, no invitation, other rows landinRowUnitrethrowsCreationRefusedas the row's error; the password and the invitation target are recorded after the unit returnsa row whose join is refused,a refused row under the temporary policy; dogfood I1updateDatainrunAdminImportUserscallsinRowUnit('existing', …)upsert:casesrunImportwithdryRunwrites no rowa dry run with a current organization joins nothingmultiOrgCreationJoinsCurrentOrganizationanswers falseCONTROL single-org (or a degraded wall)The unit pins are the multi-org describe of
packages/plugins/plugin-auth/src/admin-import-users-manager-pass.test.ts; the dogfood pins are I1 and I2 ofpackages/qa/dogfood/test/create-user-organization-join.dogfood.test.ts.Where the note differs from the card's drafted paragraph, and why:
bulk importout of the list). The claim's form is add-only, so the sentence is untouched and the note says where it no longer holds.no organization pluginis written as the code tests it: noaddMemberon better-auth's API.no unit of workis the host wiring no seam for the creation.multi modeis writtenunder a walled posture, the amendment's own words for the predicate, because a degraded wall is multi-requested and does not join.whichever other organizations that user already belongs to. This is read from the code, not from a pin: the membership probe injoinCurrentOrganizationasks only about the current organization, and the import matches users across the deployment. The contract review of PR fix(plugin-auth)!: import-users joins each row to the administrator's current organization in multi-org mode #34750 (6946273468) raised the same consequence for the approver.beginTransactionruns the callback with no rollback). The seam's own comment inauth-plugin.tsstates that limit, and the same contract review lists it as inherited from Create User.501on a dry run is true by the code path (the settlement precedesrunImportwhateverdryRunsays); the pin covers400on a dry run and501on a real run.Nothing moved in review after PR #34750's table was written. The PR has no review comment and no submitted review; its last two commits type a test harness and repair one docs anchor.
git log 36af6b05a7..4443014630over the four files above,auth-plugin.tsandreconcile-membership.tsanswers 0 commits, andgit merge-base --is-ancestor 36af6b05a7 4443014630answers exit 0.Notes for the seat, not acted on here:
is rewritten by the implementing PR. The claim chose the add-only note instead. This PR follows the claim; the difference from the ruling's letter is the approver's to accept.node scripts/pm/overlap-check.mjs --branch=HEADanswers exit 1: this branch merges cleanly withorigin/main(6d2db1d7ef) and conflicts with open PR docs(adr-0093): a sign-up admitted by its invitation alone is not bound while its address is unverified #34909 in this file. The conflict is the status line alone (each side appends oneAmendedentry to the same line); the D1 and D7 hunks of that PR and the D3 hunk here merge cleanly. Whichever lands second mergesmainand keeps both entries. The claim recorded no open PR on this file; that reading was wrong at claim time.Verification
Head
1a6abb30dd, one commit onorigin/main4443014630.Derived gates on 1a6abb3: 21 derived, 21 run, 0 NOT-MEASURED, 0 UNRUN
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 21 commands from the one changed path. Each ran with stdin closed and its exit recorded before any pipe; all 21 answered exit 0.node scripts/pm/dispatch-gates.mjs --ranon that record:21 derived famil(ies) accounted for — 21 run, 0 NOT-MEASURED.pnpm check:adr-symbol-anchors:3756 anchors across 158 records resolve. The note carries 5 of them (3 symbol, 2 file-level), read with the gate's ownextractAnchors.node scripts/check-adr-links.mjs:1151 relative link destination(s) under docs/adr/ resolve.pnpm check:adr-index:OK — docs/adr/README.md is current, every record parsed.pnpm check:adr-anchors,pnpm check:doc-authoring,pnpm check:nul-bytes,pnpm check:pm-governed-merges,pnpm check:pm-prior-rulings: exit 0.pnpm --filter @objectstack/lint run check:doc-formula-expressionsfirst answered exit 3 (prerequisite:@objectstack/formulaand@objectstack/lintnot built in this worktree). Afterturbo run buildof those two under the verify lock (VERDICT command-exit 0), it answered exit 0.Governed reading
node scripts/pm/dispatch-gates.mjs --tier: model tier MANDATORY fordocs/adr/**; changed lines 35 (+34 / −1), under the 3000 threshold. Thecheck-governed-merges.mjs --prreading is posted in the report on #34809 once this PR has a number.Generated by Claude Code